<form name="myForm" novalidate="novalidate">
    <div class="form-group">
        <label for="bookName" class="control-label">书名</label>
        <input type="text" class="form-control" id="bookName" ng-model="bookName" placeholder="请输入书名" autocomplete="off" name="bookName" ng-required="true">
    </div>
    <div class="form-group">
        <label for="bookPrice" class="control-label">价格</label>
        <input type="text" class="form-control" id="bookPrice" ng-model="bookPrice" placeholder="请输入价格" autocomplete="off" ng-required="true" name="bookPrice" ng-pattern="/^\d+(\.\d+)?$/">
        <div class="alert alert-danger" ng-show="myForm.bookPrice.$error.required&&myForm.bookPrice.$dirty">价格不能为空，请填写</div>

    <div class="form-group">
        <label for="bookCover" class="control-label">封面</label>
        <input type="text" class="form-control" id="bookCover" ng-model="bookCover" placeholder="请添加封面" autocomplete="off" name="bookCover" ng-required="true">
    </div>

    <div class="form-group">
        <button class="btn btn-primary" ng-disabled="myForm.$invalid" ng-click="addBook()">添加</button>
    </div>
</form>